package com.example.hospitalmanagementapp

import adapter.IdCardAdapter
import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import kotlinx.android.synthetic.main.activity_people_list.*

class PeopleListActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_people_list)
        initView()
    }

    private fun initView() {
        // 设置布局适配器
        people_list.layoutManager=LinearLayoutManager(this)
        var dataList:MutableList<IdModel> = mutableListOf(
            IdModel(
                "王凡",
                "612326********591X",
                "3"
            )
        )
        var adapter=IdCardAdapter(this)
        adapter.dataList=dataList
        people_list.adapter=adapter
        //跳转
        add_people.setOnClickListener {
            startActivity(Intent(this,PeopleInformationActivity::class.java))
        }
        //跳转
        add_people_btn.setOnClickListener {
            startActivity(Intent(this,PeopleInformationActivity::class.java))
        }
    }
}